package com.example.dnfgamercommunitybackend.controller;

import com.example.dnfgamercommunitybackend.entity.Account;
import com.example.dnfgamercommunitybackend.service.AuthorizationService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Generated;
import javax.annotation.Resource;

@RestController
public class AuthorizationController {
    @Resource
    private AuthorizationService authorizationService;

    @PostMapping("/user/login")
    public String login(@RequestBody Account account){
        return authorizationService.login(account);
    }

    @GetMapping("/user/logout")
    public String logout(){
        return authorizationService.logout();
    }
}
